package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-11-16
 * Time: 20:27
 */
class Animal{
    public String name;
    public String sex;

    public Animal(String name,String sex){
        this.name = name;
        this.sex = sex;

    }

}

class Dog extends Animal{
    public Dog(String name, String sex) {
        super(name,sex);
    }
    public void print(){
        System.out.println(this.sex+"狗"+this.name+"正在吃shi");
    }
}
public class Test1 {
    public static void main(String[] args) {
        Dog dog = new Dog("diaozhatian","公");
        dog.print();
    }
}
